import serves from './axios'
import store from '@/store/index'

// 获取网站配置
export function postpagedata() {
    return serves({
        url: '/admin/getWebConfig',
        method: 'post',
        data: {
            token: store.state.token
        }
    })
}

// 修改网站配置
export function updateWebConfig(data) {
    console.log(store.state.token);
    return serves({
        url: '/admin/updateWebConfig',
        method: 'post',
        data: {
            token: store.state.token,
            ...data
        }
    })
}

// 通用上传文件
export function updateFile(file) {
    return serves({
        url: 'admin/updateFile',
        method: 'post',
        data:file,
        headers: {
            "Content-Type":"multipart/form-data"
        }
    })
}

// 获取留言列表
export function getLeaveMessageList() {
    return serves({
        url: 'admin/getLeaveMessageList',
        method: 'post',
        data: {
            token: store.state.token
        }
    })
}